<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/shoppingCar(3).js"></script>
    <style>
         #lastTr{
            width: 200px;
        }
        th,td,tr{
            border: 1px #000000 solid;
            width: 200px;
            text-align: center;
            height: 40px;
        }
        #tables{
            border-collapse: collapse;
        }
        img{
            width: auto;
            height: 40px;
        }
        #number,#button1,#button2{
            float: left;
            width: 20px;
        }
        #number{
            width: 30px;
            /* border: 1px solid black; */
        }
        #button1,#button2{
            border: none;
            background-color: rgb(206, 202, 202);
        }
        #sy{
            /* border: 1px solid red; */
            width: 72px;
            margin: auto;
        }
        #input1{
            width: 25px;
            border: none;
        }
       
    </style>
</head>
<body>
    <div id="Test"></div>
    <!-- <img src="D:/Backup/Documents/My Pictures/图片素材/少儿类/儿童文学/白海豹.jpg" alt=""> -->
    <script>
        var test=[{id:"序号",name:"名字",picture:"图片",price:"单价",number:"数量",money:"金额"},
            {id:1,name:"白海豹",picture:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fbpic.588ku.com%2Felement_origin_min_pic%2F17%2F09%2F11%2F5d6d4a8b48117a76fa8a2b3b289faa76.jpg&refer=http%3A%2F%2Fbpic.588ku.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1623740128&t=7bf078e3f166410b47ba8852c4922383",price:"100元",number:0,money:0},
            {id:1,name:"白海豹",picture:"./白海豹.jpg",price:"100元",number:0,money:0}];
            window.onload = function () {
            createTable("Test",test);
        }
    </script>
    <script>
class Goods{
    constructor(id,name,picture,price,number,money){
        this.id=id;
        this.name=name;
        this.picture=picture;
        this.price=price;
        this.number=number;
        this.money=money;
    }
}
for(let i=1;i<test.length;i++){
    test[i].__proto__.constructor=Goods;
    
}
// let g1=new Goods(test[1]);
// let g2=new Goods(test[2]);

        
    </script>
</body>
</html>